import request from '@/config/axios'

// IM分组 VO
export interface GroupVO {
  id: number // 编号
  groupLogo: string // 分组封面
  groupBanner: string // 分组海报
  groupName: string // 分组名称
  groupType: number // 分组类型
  groupRemark: string // 分组简洁
}

// IM分组 API
export const GroupApi = {
  // 查询IM分组分页
  getGroupPage: async (params: any) => {
    return await request.get({ url: `/im/group/page`, params })
  },

  // 查询IM分组详情
  getGroup: async (id: number) => {
    return await request.get({ url: `/im/group/get?id=` + id })
  },

  // 新增IM分组
  createGroup: async (data: GroupVO) => {
    return await request.post({ url: `/im/group/create`, data })
  },

  // 修改IM分组
  updateGroup: async (data: GroupVO) => {
    return await request.put({ url: `/im/group/update`, data })
  },

  // 删除IM分组
  deleteGroup: async (id: number) => {
    return await request.delete({ url: `/im/group/delete?id=` + id })
  },

  // 导出IM分组 Excel
  exportGroup: async (params) => {
    return await request.download({ url: `/im/group/export-excel`, params })
  },
}